﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Text.RegularExpressions;
using System.Web.Security;
using System.Configuration;

public partial class MasterPage : System.Web.UI.MasterPage
{
    //int IsNewAnno = 0;
    //int IsNewNotice = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text = Session["uname"].ToString();
        //SqlConnection sqlcon = null;
        //SqlCommand sqlcmd = null;
        //SqlDataReader read = null;
        //string cmd = "";
        //try
        //{
        //    sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["testLottery"].ConnectionString);
        //    sqlcon.Open();
        //    cmd = "select announcement,notice from member where id='" + Session["uid"] + "'";
        //    sqlcmd = new SqlCommand(cmd, sqlcon);
        //    read = sqlcmd.ExecuteReader();
        //    read.Read();
        //    if (read.GetValue(0).ToString() == "")
        //    {
        //        IsNewAnno = 0;
        //    }
        //    else
        //    {
        //        IsNewAnno = 1;
        //    }
        //    if (read.GetValue(1).ToString() == "")
        //    {
        //        IsNewNotice = 0;
        //    }
        //    else
        //    {
        //        IsNewNotice = 1;
        //    }
        //}
        //catch (SqlException sqle)
        //{
        //    ;
        //}
        //finally
        //{
        //    sqlcon.Close();
        //}
    }
    protected void Logout_Click(object sender, EventArgs e)
    {
        Session["uid"] = null;
        Session["group"] = null;
        Session["uname"] = null;
        Session["password"] = null;
        Session.Abandon();
        Response.Redirect("../Login.aspx");
    }
}
